package com.allwayz.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author allwayz
 */
@Configuration
public class GateWayConfig {
    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder){
        return routeLocatorBuilder.routes()
                //.route("",r -> r.path("/youtube").uri("https://www.youtube.com"))
                .route("path_route_allwayz",r ->r.path("/baidu").uri("http://news.baidu.com/guoji")).build();
    }
}
